package com.ryan.spring.annotation.tx;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by kaimin on 29/1/2019.
 * time : 17:40
 */
@Service
public class TestService {
    @Autowired
    private TestDao testDao;

    @Transactional
    public void insert(String name){
        testDao.insert(name);
//        System.out.println("插入成功");
        int r=1/0;
    }
}
